<%@ page import="java.sql.*" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/25
  Time: 9:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% request.setCharacterEncoding("UTF-8") ;%>
<html>
<head>
    <title>添加用户</title>
    <style type="text/css">
        button a {
            text-decoration: none;
        }

    </style>
    <script type="text/javascript">
        function validateForm()
        {
            var x=document.forms["form"]["name"].value;
            var y=document.forms["form"]["password"].value;
            if (x==null || x=="")
            {
                alert("用户名不能为空！");
                return false;
            }
            if (y==null || y=="")
            {
                alert("密码不能为空！");
                return false;
            }
        }
    </script>
</head>
<body>
<button type="button"><a href="/userList.jsp">返回列表</a></button>

<form method="post" action="userAddAction.jsp" name="form" onsubmit="return validateForm()" >
    用户名：<input type="text" name="name" ><br/>
    密码：<input type="text" name="password"><br/>
    <button type="submit">添加</button>
</form>
<jsp:include page="footer.jsp">
    <jsp:param name="year" value="2017"/>
</jsp:include>
</body>
</html>
